import java.math.BigInteger;
import static java.lang.System.out;

public class mulitply{

    public static int[] bigMultipy(char[] a,char[] b){
        int[] result= new int[a.length+b.length];
        int[] tempa = new int[a.length];
        int[] tempb = new int[b.length];
        int p=0;
        //将result初始化为0
        for(int i=0;i<result.length;i++)
            result[i]=0;
        //将数组a排序调换一下
        for(int i=0;i<a.length;i++){
            tempa[a.length-1-i] = (int)(a[i]-'0');
        }
        //将数组b排序调换一下
        for(int i =0;i<b.length;i++){
            tempb[b.length-1-i] = (int)(b[i]-'0');
        }
        for(int i=0;i<a.length;i++){
            for(int j=0;j<b.length;j++){
                result[i+j] += tempa[i]*tempb[j];
            }
        }
        for(int i=0;i<result.length-1;i++){
            if(result[i]>=10){
                p = result[i]/10;
                result[i+1] +=p;
                result[i] = result[i]-p*10;
            }
        }

        return result;
    }
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        BigInteger i = new BigInteger("999999999");
        BigInteger j = new BigInteger("999999999");
        BigInteger z = i.multiply(j);
        int a = 999999999;
        int b = 999999999;
        int[] c = bigMultipy(String.valueOf(a).toCharArray(),String.valueOf(b).toCharArray());
        for(int k=c.length-1;k>=0;k--){
            out.print(c[k]);
        }
        out.println();
        //            System.out.println(z);
        out.println(z);
    }

}